package com.wsx.ones.monitor.core.transport;

import java.io.IOException;
import java.net.InetSocketAddress;

/**
 * 数据传输异常定义
 * Created by wangshuaixin on 17/2/4.
 */
public class TransportException extends IOException {

    private InetSocketAddress localAddress;
    private InetSocketAddress remoteAddress;


    public TransportException(InetSocketAddress localAddress, InetSocketAddress remoteAddress, String message) {
        super(message);
        this.localAddress = localAddress;
        this.remoteAddress = remoteAddress;
    }

    @SuppressWarnings("Since15")
    public TransportException(InetSocketAddress localAddress, InetSocketAddress remoteAddress, String message, Throwable throwable) {
        super(message,throwable);
        this.localAddress = localAddress;
        this.remoteAddress = remoteAddress;
    }

    public InetSocketAddress getLocalAddress() {
        return localAddress;
    }

    public InetSocketAddress getRemoteAddress() {
        return remoteAddress;
    }
}
